package client;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import system.*;
import db.*;

import javax.swing.*;

public class FeedBack extends JFrame implements ActionListener{

	private String  dialog;
	private JLabel feedBack;
	private JButton end;

	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				FeedBack inst = new FeedBack("good");
				
			}
		});
	}
	
	public FeedBack(String log) {
		super();
		this.dialog=log;
		initGUI();
		setLocationRelativeTo(null);
		setVisible(true);
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			setLayout(null);
			{
				feedBack = new JLabel();
				getContentPane().add(feedBack, BorderLayout.CENTER);
				feedBack.setText(dialog);
				feedBack.setBounds(34, 29, 199, 86);
				feedBack.setHorizontalAlignment(JLabel.CENTER);
			}
			{
				end = new JButton();
				getContentPane().add(end);
				end.setText("\u786e\u8ba4");
				end.setBounds(70, 127, 124, 50);
				end.addActionListener(this);
			}
			pack();
			this.setSize(285, 228);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource()==end){
			this.dispose();
		}
		
	}

}
